/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sa_prakt1.bl.services.impl.standard;

import sa_prakt1.bl.entity.impl.standard.DefaultEntry;
import sa_prakt1.bl.entity.impl.standard.DefaultForum;
import sa_prakt1.bl.entity.impl.standard.DefaultMember;
import sa_prakt1.bl.entity.interfaces.Entry;
import sa_prakt1.bl.entity.interfaces.Forum;
import sa_prakt1.bl.entity.interfaces.Member;
import sa_prakt1.bl.services.interfaces.SamCommCreator;

/**
 *
 * @author Andreas
 */
public class DefaultSamCommCreator implements SamCommCreator{
    
    private static DefaultSamCommCreator instance;

    //Sichtbarkeit protected wegen singleton
    protected DefaultSamCommCreator() {
    }

    /**
     * Singleton pattern
     * 
     * @return EjbCreator
     */
    public static DefaultSamCommCreator getInstance() {

        if (instance == null) {
            instance = new DefaultSamCommCreator();
        }
        return instance;
    }

    @Override
    public Forum createForum(String titel) {
        String id = "df1";
        DefaultForum df = new DefaultForum(id,titel);
        return df;
    }

    @Override
    public Member createMember(String nickname, String email, String passwort) {
        String id = "dm1";
        int points = 0;
        DefaultMember dm = new DefaultMember(id,nickname,email,passwort,points);
        return dm;
    }

    @Override
    public Entry createEntry(Member author, Forum forum, String title, String text) {
        
        
        String id = "de1";
        DefaultEntry de = new DefaultEntry(id, title, text, author, forum);
        return de;

    }

    
}
